<%@page import="vlc.StreamContext"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%
	if ("true".equals(request.getParameter("stop"))) {
		StreamContext.getInstance().stopStream();
	}

	if (session.getAttribute("mrl") == null) {
		session.setAttribute("mrl", "screen://");
		//session.setAttribute("mrl", "dshow://");
	}
	if (session.getAttribute("adress") == null) {
		session.setAttribute("adress", "localhost:5555");
	}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="UTF-8" />
<link rel="stylesheet" href="./css/style.css" />
<title>VLCSA Streaming Administrative Tool</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
</head>

<body>


	<div id="wrapper">
		<div id="wrapper_inner">

			<div id="toplinks">
				<div id="toplinks_inner">

					<ul>
						<li><a href="index.jsp">Client page</a> |</li>
						<li><a href="<%=request.getContextPath()%>/LogoutServlet">Log
								out</a></li>
					</ul>

					<div class="clearer">&nbsp;</div>

				</div>
			</div>

			<div class="clearer">&nbsp;</div>

			<div id="header">
				<div id="header_inner">
					<h1>
						<a href="index.jsp">VLCSA</a>
					</h1>
					<p>
						<span>Video Camera Streaming Application</span>
					</p>
					<a href="index.jsp">Return to client page</a>&nbsp; &nbsp; <a
						href="<%=request.getContextPath()%>/LogoutServlet">Log-out</a>
				</div>
			</div>


			<div id="main">
				<h1>Streaming Configuration</h1>
				<div class="notice">This page is only available for
					administrator of VLCSA.</div>

				<table border=3>
					<tr>
						<td>Current status</td>
						<td>

							<form method="POST" action="VlcStream" name="videoForm">

								<span id="status"> <%
 	if (StreamContext.getInstance().isPlaying()) {
 		out.println("<h2>Playing</h2>");
 	} else {
 		out.println("<div class='box_title'>Not playing</div>");
 	}
 %>
								</span>
						</td>
					</tr>
					<tr>
						<td>Stream MRL</td>
						<td><input type="text" name="s_mrl"
							value="<%//out.print(StreamContext.getInstance().getMrl());
			out.print(session.getAttribute("mrl"));%>"></td>
					</tr>
					<tr>
						<td>Stream address</td>
						<td><input type="text" name="s_adress"
							value="<%//out.print(StreamContext.getInstance().getStreamUrl());
			out.print(session.getAttribute("adress"));%>"></td>
					</tr>
					<tr>
						<td>Video fromat</td>
						<td><input type="radio" name="codec" value="WebM"
							checked="checked">WebM <input type="radio" name="codec"
							value="Theora">Theora <input type="radio" name="codec"
							value="H264">H264</td>
					</tr>
					<tr>
						<td><input type="submit" value="Start Streaming"
							<%if (StreamContext.getInstance().isPlaying()) {
				out.print(" disabled");
			}%> /></td>
						</form>
						<td>
							<form method="POST" action="adminTool.jsp" name="stopForm">
								<input type="hidden" name="stop" value="true"> <input
									type="submit" value="Stop Streaming" onclick="stopVideo()" />
							</form>
						</td>

					</tr>
				</table>
			</div>
		</div>
	<div class="clearer">&nbsp;</div>
		<div id="footer">
			<div id="footer_inner">

				<div class="left">
					&copy; Centre hospitalier universitaire Sainte-Justine All rights
					reserved. <br />&copy; 2008 Website.com - Your Site Slogan
				</div>

				<div class="right">
					<a href="http://templates.arcsin.se/">Website template</a> by <a
						href="http://arcsin.se/">Arcsin</a>
				</div>

				<div class="clearer">&nbsp;</div>

			</div>
		</div>
	</div>


	</div>
</body>
</html>
